﻿<UserControl x:Class="EFS.RC.Wallboard.Controls.Common.ImageCenterTextRectangle"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="100" d:DesignWidth="100" BorderBrush="DarkGray" BorderThickness="2">
    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*"></ColumnDefinition>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="80*"></RowDefinition>
			<RowDefinition Height="20*"></RowDefinition>
		</Grid.RowDefinitions>
		<!-- The viewbox will stretch its content to fit the final size of the button -->
		<Viewbox Grid.Row="0" Grid.Column="0" Height="Auto" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
			<!-- The image and its contents are stretched to fill its parent -->
			<Image Height="24" HorizontalAlignment="Center" Margin="5,5,5,5" Name="image" Stretch="Fill" VerticalAlignment="Center" Width="24" Source="/EFS.RC.Wallboard;component/Resources/Icons/wallboard.ico" />
		</Viewbox>
		<!-- The viewbox will stretch its content to fit the final size of the button -->
		<Viewbox Grid.Row="1" Grid.Column="0" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto">
			<!-- The textblock and its contents are stretched to fill its parent -->
			<TextBlock HorizontalAlignment="Center" Name="textBlock" Text="N/A" VerticalAlignment="Center" FontWeight="UltraBold" Width="Auto" Height="Auto" Foreground="Black" FontStretch="Normal" Padding="5,0,5,5" TextAlignment="Center" TextTrimming="None" />
		</Viewbox>
		<Grid.Background>
			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
				<GradientStop Color="LightGray" Offset="1" />
				<GradientStop Color="#00ADD8E6" Offset="0" />
			</LinearGradientBrush>
		</Grid.Background>
	</Grid>
</UserControl>